#ifndef CMAINMAPTHREAD_H
#define CMAINMAPTHREAD_H

#include <QPropertyAnimation>
#include <QKeyEvent>
#include <QLabel>
#include <QPixmap>

#include "../Models/MCharacter.h" // Modifié
#include "../Models/MStaticData.h"
#include "../Views/VBomb.h"
#include "CTcpNetwork.h"
#include "../Controlers/CEditor.h"

class CMainMap: public QWidget
{
    Q_OBJECT

private:
    MCharacter *character; // Modifié
    QLabel *character_label;
    QLabel *grid_label;
    QList<QPixmap *> *character_image;
    QList<MCharacter *> players;// Modifié

public:
    CMainMap(QLabel *character_label, QList<QPixmap *> *character_image);
    ~CMainMap();
    int is_moving(QPropertyAnimation *animation);
    int is_not_built(int x, int y, CEditor *editor_data);
    void handle_key(QLabel *grid_label, QPropertyAnimation *animation, QKeyEvent *event, CEditor *editor_data);
    int get_pos_x();
    int get_pos_y();

public slots:
    void animation_state_changed(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
    void add_player();
    void add_player(int id, int pos_x, int pos_y, int position); // Modifié
    void add_bomb(int x, int y);

signals:
    void on_gate();

    friend class VMainMap; // Modifié
};

#endif
